import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

import { BaseHttpService } from '../base-http.service';

export interface UserDepartment {
  id: number;
  userid: number;
  deptid: number;
}

@Injectable({
  providedIn: 'root'
})
export class UserDepartmentService {
  apiPrefix: string = 'userdepartment';
  constructor(private readonly http: BaseHttpService) {}

  public getUserDepartments(params: object): Observable<UserDepartment[]> {
    return this.http.get<UserDepartment[]>(`/${this.apiPrefix}/getall`, params);
  }
}
